package org.example.domain.activity.service.quota.rule.factory;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.example.domain.activity.service.quota.rule.IActivityChain;
import org.springframework.stereotype.Service;

import java.util.Map;
@Slf4j
@Service
public class DefaultActivityChainFactory{
    private final IActivityChain actionChain;
    public DefaultActivityChainFactory(Map<String,IActivityChain> ActivityChainMap){
        actionChain = ActivityChainMap.get(ActionModel.ACTIVITY_BASE.code);
        actionChain.appendNext(ActivityChainMap.get(ActionModel.ACTIVITY_STOCK.code));

    }
    public IActivityChain openActivityChain() {

        return this.actionChain;
    }
    @Getter
    @AllArgsConstructor
    private enum ActionModel{
        ACTIVITY_BASE("activity_base_action","活动基础信息"),
        ACTIVITY_STOCK("activity_stock_action","活动库存")
        ;
        private String code;
        private String info;
    }
}
